import 'package:flutter/material.dart';
import 'package:flutter_bilibili/core/extension/int_extension.dart';
import 'package:flutter_bilibili/ui/shared/app_theme.dart';

class HYAdvertisingRow extends StatelessWidget {
  String image;
  String title;
  Widget rightBtn;

  HYAdvertisingRow(
      {required this.image, required this.title, required this.rightBtn});

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          decoration: BoxDecoration(
              color: Color.fromRGBO(246, 247, 249, 1),
              borderRadius: BorderRadius.all(Radius.circular(3.px))),
          padding: EdgeInsets.symmetric(horizontal: 12.px, vertical: 10.px),
          child: Row(
            children: [
              SizedBox(
                child: Image.asset(image),
                height: 18.px,
                width: 18.px,
              ),
              SizedBox(
                width: 10.px,
              ),
              Text(
                title,
                style: TextStyle(
                    color: Colors.black, fontSize: HYAppTheme.xSmallFontSize),
              ),
            ],
          ),
        ),
        Positioned(
          child: rightBtn,
          right: 10.px,
          top: 0,
          bottom: 0,
        )
      ],
    );
  }
}
